/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author LYS
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page, TreeDataModel } from '../../model/baseModel';

const { adminPath } = useGlobSetting();

export interface PLMDocInfo extends BasicModel<PLMDocInfo> {
  cdocumentid?: string; // 文档编码
  cdocumentver?: string; // 文档版本
  cdocumentname?: string; // 文档名称
  cdmodifytime?: string; // 修改时间
  cdmodifynum?: string; // 修改次数
  cdformat?: string; // 格式
  cdsize?: string; // 大小
  cdpagesize?: string; // 页大小
  cddetail?: string; // 摘要
  cdlock?: string; // 文档状态
  cdkeyword?: string; // 关键字
  cdremark?: string; // 备注
  cdmodelid?: string; // 模板编号
  cmkindid?: number; // 分类ID
  cinstanceflowid?: string; // 流程ID
  cprojectid?: string; // 项目编号
  cphaseid?: string; // 阶段编号
  cactiveid?: string; // 任务编号
  cproduct?: string; // 产品编号
  cprimarydocid?: string; // cprimarydocid
  cprimarydocver?: string; // cprimarydocver
  ccreatorid?: string; // 创建人
  cfrezontime?: string; // cfrezontime
  cisencryption?: string; // cisencryption
  sourceid?: number; // 文档来源
  secrecygradeid?: number; // 文档密级
  validtime?: string; // 生效时间
  trashtime?: string; // 失效时间
  englishname?: string; // 英文名称
  backup1?: string; // backup1
  backup2?: string; // backup2
  isprint?: string; // 是否已打印
  issuance?: string; // 文档发放
  sortid?: number; // 文档类型
  ctimestamp?: string; // ctimestamp
  checkdoctimestamp?: string; // checkdoctimestamp
  ismainfile?: string; // ismainfile
  cmodifier?: string; // 修改人
  createtime?: string; // 创建时间
  modifynum?: number; // 修改次数
  cdprintnum?: number; // 打印次数
  cdwidth?: string; // cdwidth
  cdheight?: string; // cdheight
}

export const pLMDocInfoList = (params?: PLMDocInfo | any) =>
  defHttp.get<PLMDocInfo>({ url: adminPath + '/plm/doc/pLMDocInfo/list', params });

export const pLMDocInfoListData = (params?: PLMDocInfo | any) =>
  defHttp.post<Page<PLMDocInfo>>({ url: adminPath + '/plm/doc/pLMDocInfo/listData', params });

export const pLMDocInfoForm = (params?: PLMDocInfo | any) =>
  defHttp.get<PLMDocInfo>({ url: adminPath + '/plm/doc/pLMDocInfo/form', params });

export const pLMDocInfoSave = (params?: any, data?: PLMDocInfo | any) =>
  defHttp.postJson<PLMDocInfo>({ url: adminPath + '/plm/doc/pLMDocInfo/save', params, data });

export const pLMDocInfoDelete = (params?: PLMDocInfo | any) =>
  defHttp.get<PLMDocInfo>({ url: adminPath + '/plm/doc/pLMDocInfo/delete', params });

export const pLMDocInfoTreeData = (params?: any) =>
  defHttp.get<TreeDataModel[]>({ url: adminPath + '/plm/doc/pLMDocInfo/kindData', params });

export const pLMDocInfo = (params?: any) =>
  defHttp.get<TreeDataModel[]>({ url: adminPath + '/plm/file/previewJson', params });
